package com.ymttest.database.mapping.thirdpartysync;

import com.ymttest.database.model.thirdpartysync.promotionproduct;
import com.ymttest.database.model.thirdpartysync.promotionproductExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface promotionproductMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table promotionproduct
     *
     * @mbggenerated Sat Jan 04 17:38:27 CST 2020
     */
    @SelectProvider(type=promotionproductSqlProvider.class, method="countByExample")
    int countByExample(promotionproductExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table promotionproduct
     *
     * @mbggenerated Sat Jan 04 17:38:27 CST 2020
     */
    @DeleteProvider(type=promotionproductSqlProvider.class, method="deleteByExample")
    int deleteByExample(promotionproductExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table promotionproduct
     *
     * @mbggenerated Sat Jan 04 17:38:27 CST 2020
     */
    @Delete({
        "delete from promotionproduct",
        "where Id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table promotionproduct
     *
     * @mbggenerated Sat Jan 04 17:38:27 CST 2020
     */
    @Insert({
        "insert into promotionproduct (Id, ProductId, ",
        "SellerId, Commission, ",
        "StartTime, EndTime, ",
        "DyCategoryIds, DyCategoryNames, ",
        "CreateTime, UpdateTime)",
        "values (#{id,jdbcType=INTEGER}, #{productId,jdbcType=VARCHAR}, ",
        "#{sellerId,jdbcType=INTEGER}, #{commission,jdbcType=DECIMAL}, ",
        "#{startTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP}, ",
        "#{dyCategoryIds,jdbcType=VARCHAR}, #{dyCategoryNames,jdbcType=VARCHAR}, ",
        "#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})"
    })
    int insert(promotionproduct record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table promotionproduct
     *
     * @mbggenerated Sat Jan 04 17:38:27 CST 2020
     */
    @InsertProvider(type=promotionproductSqlProvider.class, method="insertSelective")
    int insertSelective(promotionproduct record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table promotionproduct
     *
     * @mbggenerated Sat Jan 04 17:38:27 CST 2020
     */
    @SelectProvider(type=promotionproductSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="Id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="ProductId", property="productId", jdbcType=JdbcType.VARCHAR),
        @Result(column="SellerId", property="sellerId", jdbcType=JdbcType.INTEGER),
        @Result(column="Commission", property="commission", jdbcType=JdbcType.DECIMAL),
        @Result(column="StartTime", property="startTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="EndTime", property="endTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="DyCategoryIds", property="dyCategoryIds", jdbcType=JdbcType.VARCHAR),
        @Result(column="DyCategoryNames", property="dyCategoryNames", jdbcType=JdbcType.VARCHAR),
        @Result(column="CreateTime", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="UpdateTime", property="updateTime", jdbcType=JdbcType.TIMESTAMP)
    })
    List<promotionproduct> selectByExample(promotionproductExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table promotionproduct
     *
     * @mbggenerated Sat Jan 04 17:38:27 CST 2020
     */
    @Select({
        "select",
        "Id, ProductId, SellerId, Commission, StartTime, EndTime, DyCategoryIds, DyCategoryNames, ",
        "CreateTime, UpdateTime",
        "from promotionproduct",
        "where Id = #{id,jdbcType=INTEGER}"
    })
    @Results({
        @Result(column="Id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="ProductId", property="productId", jdbcType=JdbcType.VARCHAR),
        @Result(column="SellerId", property="sellerId", jdbcType=JdbcType.INTEGER),
        @Result(column="Commission", property="commission", jdbcType=JdbcType.DECIMAL),
        @Result(column="StartTime", property="startTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="EndTime", property="endTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="DyCategoryIds", property="dyCategoryIds", jdbcType=JdbcType.VARCHAR),
        @Result(column="DyCategoryNames", property="dyCategoryNames", jdbcType=JdbcType.VARCHAR),
        @Result(column="CreateTime", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="UpdateTime", property="updateTime", jdbcType=JdbcType.TIMESTAMP)
    })
    promotionproduct selectByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table promotionproduct
     *
     * @mbggenerated Sat Jan 04 17:38:27 CST 2020
     */
    @UpdateProvider(type=promotionproductSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") promotionproduct record, @Param("example") promotionproductExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table promotionproduct
     *
     * @mbggenerated Sat Jan 04 17:38:27 CST 2020
     */
    @UpdateProvider(type=promotionproductSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") promotionproduct record, @Param("example") promotionproductExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table promotionproduct
     *
     * @mbggenerated Sat Jan 04 17:38:27 CST 2020
     */
    @UpdateProvider(type=promotionproductSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(promotionproduct record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table promotionproduct
     *
     * @mbggenerated Sat Jan 04 17:38:27 CST 2020
     */
    @Update({
        "update promotionproduct",
        "set ProductId = #{productId,jdbcType=VARCHAR},",
          "SellerId = #{sellerId,jdbcType=INTEGER},",
          "Commission = #{commission,jdbcType=DECIMAL},",
          "StartTime = #{startTime,jdbcType=TIMESTAMP},",
          "EndTime = #{endTime,jdbcType=TIMESTAMP},",
          "DyCategoryIds = #{dyCategoryIds,jdbcType=VARCHAR},",
          "DyCategoryNames = #{dyCategoryNames,jdbcType=VARCHAR},",
          "CreateTime = #{createTime,jdbcType=TIMESTAMP},",
          "UpdateTime = #{updateTime,jdbcType=TIMESTAMP}",
        "where Id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(promotionproduct record);
}